//
//  Student.m
//  base_m_07_@class关键字
//
//  Created by China Dragon on 2023/1/30.
//

#import "Student.h"

@implementation Student

- (void)setBook:(Book *)book{
    if(_book != book){
        _book = book;
//        [_book release]
//        _book = [book retain]
    }
}
- (Book *)book{
    return _book;
}

- (void)dealloc{
    self.book = nil;//释放book 比  [_book release] 更彻底
    //或者下面
    [self setBook:nil];//释放book 比  [_book release] 更彻底 
    
    
//    [_book release];
//    [super dealloc];
}

@end
